3.18 \(\int \cosh ^2(a+b x+c x^2) \, dx\)

Optimal. Leaf size=110 \[ \frac{\sqrt{\frac{\pi }{2}} e^{\frac{b^2}{2 c}-2 a} \text{Erf}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}+\frac{\sqrt{\frac{\pi }{2}} e^{2 a-\frac{b^2}{2 c}} \text{Erfi}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}+\frac{x}{2} \]

[Out]

x/2 + (E^(-2*a + b^2/(2*c))*Sqrt[Pi/2]*Erf[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])])/(8*Sqrt[c]) + (E^(2*a - b^2/(2*c))*
Sqrt[Pi/2]*Erfi[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])])/(8*Sqrt[c])

________________________________________________________________________________________

Rubi [A]  time = 0.0663257, antiderivative size = 110, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {5377, 5375, 2234, 2204, 2205} \[ \frac{\sqrt{\frac{\pi }{2}} e^{\frac{b^2}{2 c}-2 a} \text{Erf}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}+\frac{\sqrt{\frac{\pi }{2}} e^{2 a-\frac{b^2}{2 c}} \text{Erfi}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}+\frac{x}{2} \]

Antiderivative was successfully verified.

[In]

Int[Cosh[a + b*x + c*x^2]^2,x]

[Out]

x/2 + (E^(-2*a + b^2/(2*c))*Sqrt[Pi/2]*Erf[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])])/(8*Sqrt[c]) + (E^(2*a - b^2/(2*c))*
Sqrt[Pi/2]*Erfi[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])])/(8*Sqrt[c])

Rule 5377

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]^(n_), x_Symbol] :> Int[ExpandTrigReduce[Cosh[a + b*x + c*x^2]^n, x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 1]

Rule 5375

Int[Cosh[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[1/2, Int[E^(a + b*x + c*x^2), x], x] + Dist[1/2
, Int[E^(-a - b*x - c*x^2), x], x] /; FreeQ[{a, b, c}, x]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rule 2205

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erf[(c + d*x)*Rt[-(b*Log[F]),
 2]])/(2*d*Rt[-(b*Log[F]), 2]), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rubi steps

\begin{align*} \int \cosh ^2\left (a+b x+c x^2\right ) \, dx &=\int \left (\frac{1}{2}+\frac{1}{2} \cosh \left (2 a+2 b x+2 c x^2\right )\right ) \, dx\\ &=\frac{x}{2}+\frac{1}{2} \int \cosh \left (2 a+2 b x+2 c x^2\right ) \, dx\\ &=\frac{x}{2}+\frac{1}{4} \int e^{-2 a-2 b x-2 c x^2} \, dx+\frac{1}{4} \int e^{2 a+2 b x+2 c x^2} \, dx\\ &=\frac{x}{2}+\frac{1}{4} e^{2 a-\frac{b^2}{2 c}} \int e^{\frac{(2 b+4 c x)^2}{8 c}} \, dx+\frac{1}{4} e^{-2 a+\frac{b^2}{2 c}} \int e^{-\frac{(-2 b-4 c x)^2}{8 c}} \, dx\\ &=\frac{x}{2}+\frac{e^{-2 a+\frac{b^2}{2 c}} \sqrt{\frac{\pi }{2}} \text{erf}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}+\frac{e^{2 a-\frac{b^2}{2 c}} \sqrt{\frac{\pi }{2}} \text{erfi}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right )}{8 \sqrt{c}}\\ \end{align*}

Mathematica [A]  time = 0.142963, size = 140, normalized size = 1.27 \[ \frac{\sqrt{\pi } \text{Erf}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right ) \left (\cosh \left (2 a-\frac{b^2}{2 c}\right )-\sinh \left (2 a-\frac{b^2}{2 c}\right )\right )+\sqrt{\pi } \text{Erfi}\left (\frac{b+2 c x}{\sqrt{2} \sqrt{c}}\right ) \left (\sinh \left (2 a-\frac{b^2}{2 c}\right )+\cosh \left (2 a-\frac{b^2}{2 c}\right )\right )+4 \sqrt{2} \sqrt{c} x}{8 \sqrt{2} \sqrt{c}} \]

Antiderivative was successfully verified.

[In]

Integrate[Cosh[a + b*x + c*x^2]^2,x]

[Out]

(4*Sqrt[2]*Sqrt[c]*x + Sqrt[Pi]*Erf[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])]*(Cosh[2*a - b^2/(2*c)] - Sinh[2*a - b^2/(2*
c)]) + Sqrt[Pi]*Erfi[(b + 2*c*x)/(Sqrt[2]*Sqrt[c])]*(Cosh[2*a - b^2/(2*c)] + Sinh[2*a - b^2/(2*c)]))/(8*Sqrt[2
]*Sqrt[c])

________________________________________________________________________________________

Maple [A]  time = 0.043, size = 94, normalized size = 0.9 \begin{align*}{\frac{x}{2}}+{\frac{\sqrt{\pi }\sqrt{2}}{16}{{\rm e}^{-{\frac{4\,ac-{b}^{2}}{2\,c}}}}{\it Erf} \left ( \sqrt{2}\sqrt{c}x+{\frac{b\sqrt{2}}{2}{\frac{1}{\sqrt{c}}}} \right ){\frac{1}{\sqrt{c}}}}-{\frac{\sqrt{\pi }}{8}{{\rm e}^{{\frac{4\,ac-{b}^{2}}{2\,c}}}}{\it Erf} \left ( -\sqrt{-2\,c}x+{b{\frac{1}{\sqrt{-2\,c}}}} \right ){\frac{1}{\sqrt{-2\,c}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cosh(c*x^2+b*x+a)^2,x)

[Out]

1/2*x+1/16*Pi^(1/2)*exp(-1/2*(4*a*c-b^2)/c)*2^(1/2)/c^(1/2)*erf(2^(1/2)*c^(1/2)*x+1/2*b*2^(1/2)/c^(1/2))-1/8*P
i^(1/2)*exp(1/2*(4*a*c-b^2)/c)/(-2*c)^(1/2)*erf(-(-2*c)^(1/2)*x+b/(-2*c)^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.56834, size = 130, normalized size = 1.18 \begin{align*} \frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (\sqrt{2} \sqrt{-c} x - \frac{\sqrt{2} b}{2 \, \sqrt{-c}}\right ) e^{\left (2 \, a - \frac{b^{2}}{2 \, c}\right )}}{16 \, \sqrt{-c}} + \frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (\sqrt{2} \sqrt{c} x + \frac{\sqrt{2} b}{2 \, \sqrt{c}}\right ) e^{\left (-2 \, a + \frac{b^{2}}{2 \, c}\right )}}{16 \, \sqrt{c}} + \frac{1}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

1/16*sqrt(2)*sqrt(pi)*erf(sqrt(2)*sqrt(-c)*x - 1/2*sqrt(2)*b/sqrt(-c))*e^(2*a - 1/2*b^2/c)/sqrt(-c) + 1/16*sqr
t(2)*sqrt(pi)*erf(sqrt(2)*sqrt(c)*x + 1/2*sqrt(2)*b/sqrt(c))*e^(-2*a + 1/2*b^2/c)/sqrt(c) + 1/2*x

________________________________________________________________________________________

Fricas [A]  time = 2.12039, size = 358, normalized size = 3.25 \begin{align*} -\frac{\sqrt{2} \sqrt{\pi } \sqrt{-c}{\left (\cosh \left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right ) + \sinh \left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right )\right )} \operatorname{erf}\left (\frac{\sqrt{2}{\left (2 \, c x + b\right )} \sqrt{-c}}{2 \, c}\right ) - \sqrt{2} \sqrt{\pi } \sqrt{c}{\left (\cosh \left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right ) - \sinh \left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right )\right )} \operatorname{erf}\left (\frac{\sqrt{2}{\left (2 \, c x + b\right )}}{2 \, \sqrt{c}}\right ) - 8 \, c x}{16 \, c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

-1/16*(sqrt(2)*sqrt(pi)*sqrt(-c)*(cosh(-1/2*(b^2 - 4*a*c)/c) + sinh(-1/2*(b^2 - 4*a*c)/c))*erf(1/2*sqrt(2)*(2*
c*x + b)*sqrt(-c)/c) - sqrt(2)*sqrt(pi)*sqrt(c)*(cosh(-1/2*(b^2 - 4*a*c)/c) - sinh(-1/2*(b^2 - 4*a*c)/c))*erf(
1/2*sqrt(2)*(2*c*x + b)/sqrt(c)) - 8*c*x)/c

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \cosh ^{2}{\left (a + b x + c x^{2} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(c*x**2+b*x+a)**2,x)

[Out]

Integral(cosh(a + b*x + c*x**2)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.34642, size = 127, normalized size = 1.15 \begin{align*} -\frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{2} \sqrt{c}{\left (2 \, x + \frac{b}{c}\right )}\right ) e^{\left (\frac{b^{2} - 4 \, a c}{2 \, c}\right )}}{16 \, \sqrt{c}} - \frac{\sqrt{2} \sqrt{\pi } \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{2} \sqrt{-c}{\left (2 \, x + \frac{b}{c}\right )}\right ) e^{\left (-\frac{b^{2} - 4 \, a c}{2 \, c}\right )}}{16 \, \sqrt{-c}} + \frac{1}{2} \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cosh(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

-1/16*sqrt(2)*sqrt(pi)*erf(-1/2*sqrt(2)*sqrt(c)*(2*x + b/c))*e^(1/2*(b^2 - 4*a*c)/c)/sqrt(c) - 1/16*sqrt(2)*sq
rt(pi)*erf(-1/2*sqrt(2)*sqrt(-c)*(2*x + b/c))*e^(-1/2*(b^2 - 4*a*c)/c)/sqrt(-c) + 1/2*x